/boot
/bufferIO
/core
Long.ts
format.ts
/headers ...
/headers/enums
DataDirectoryKind.ts
DllCharacteristics.ts
ImageCharacteristics.ts
MZSignature.ts
Machine.ts
PEMagic.ts
PESignature.ts
SectionCharacteristics.ts
Subsystem.ts
AddressRange.ts
DosHeader.ts
OptionalHeader.ts
PEFileHeaders.ts
PEHeader.ts
SectionHeader.ts
/imports
/imports/knockout
knockout-3.0.0.js
/io
BufferReader.ts
/layout
pe.css
pefile.html
/sample
sample.js
/typings
knockout.d.ts
PEFile.ts
pe.html
pe.ts
17
     */
18
    numberOfSections: number = 0;
19
 
20
    /**
21
     * The low 32 bits of the time stamp of the image.
22
     * This represents the date and time the image was created by the linker.
23
     * The value is represented in the number of seconds elapsed since
24
     * midnight (00:00:00), January 1, 1970, Universal Coordinated Time,
25
     * according to the system clock.
26
     */
27
    timestamp: Date = new Date(0);
28
 
29
    /**
30
     * UInt. The offset of the symbol table, in bytes, or zero if no COFF symbol table exists.
31
     */
32
    pointerToSymbolTable: number = 0;
33
 
34
    /**
35
     * UInt. The number of symbols in the symbol table.
36
     */
37
    numberOfSymbols: number = 0;
38
 
39
    /**
40
     * UShort. The size of the optional header, in bytes. This value should be 0 for object files.
41
     */
42
    sizeOfOptionalHeader: number = 0;
43
 
44
    /**
45
     * The characteristics of the image.
46
     */
47
    characteristics: ImageCharacteristics = ImageCharacteristics.Dll | ImageCharacteristics.Bit32Machine;
48
 
49
    toString() {
50
      var result =
51
        pe.formatEnum(this.machine, Machine) + " " +
52
        pe.formatEnum(this.characteristics, ImageCharacteristics) + " " +
53
        "Sections[" + this.numberOfSections + "]";
54
      return result;
55
    }
56
 
57
    read(reader: io.BufferReader) {
58
      this.pe = reader.readInt();
59
      if (this.pe != <number>PESignature.PE)
60
        throw new Error("PE signature is invalid: " + (<number>(this.pe)).toString(16).toUpperCase() + "h.");
61
 
62
      this.machine = reader.readShort();
63
      this.numberOfSections = reader.readShort();
64
 
65
      if (!this.timestamp)
66
        this.timestamp = new Date(0);
67
      this.timestamp.setTime(reader.readInt() * 1000);
68
 
69
      this.pointerToSymbolTable = reader.readInt();
70
      this.numberOfSymbols = reader.readInt();
71
      this.sizeOfOptionalHeader = reader.readShort();
72
      this.characteristics = reader.readShort();
73
    }
74
 
75
  }
76
}